<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>云梦公益在线读书系统</title>
  
 
<script type='text/javascript' src='<%=path %>/dwr/interface/loginService.js'></script>
	 <script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
	 <script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
	      
	 <script language="javascript">
	 function check1()
	 {                                                                                         
	     if(document.ThisForm.userName.value=="")
		 {
		 	alert("请输入用户名");
			document.ThisForm.userName.focus();
			return false;
		 }
		 if(document.ThisForm.userPw.value=="")
		 {
		 	alert("请输入密码");
			document.ThisForm.userPw.focus();
			return false;
		 }
		 
		 
		 document.getElementById("indicator").style.display="block";
		 loginService.login(document.ThisForm.userName.value,document.ThisForm.userPw.value,'A8888',0,callback);
	 }
	
	 function callback(data)
	 {
	    document.getElementById("indicator").style.display="none";
	    if(data=="no")
	    {
	        alert("用户名或密码错误");
	    }
	    if(data=="yes")
	    {
	        alert("通过验证,系统登录成功");
	        window.location.href="<%=path %>/loginSuccess.jsp";
	    }
	    if(data=="codeerror")
	    {
	        alert("验证码错误");
	    }
	    
	 }
	 </script>
  <link href="<%=path%>/css/house.AsTzRAWl12kl.5.css" rel="stylesheet" type="text/css">
 
		<link rel="stylesheet" href="<%=path%>/css/admin_login.1183079.css">
 
<body>
	<FORM action="<%=path %>/admin/index.jsp" name="ThisForm" method="post">
	<h1 style="display:none;"></h1>
		<div class="admin_login">
			<div class="content" >
				<p class="title" style="text-align: center;"> 云梦公益在线读书系统</p>
				<div class="form">
					<p class="welcome_login">欢迎登录</p>
					<div class="name clearfix">
						<span class="icon"></span>
						<input type="text"  name="userName"  placeholder="请输入用户名">
					</div>
					<div class="password clearfix">
						<span class="icon"></span>
						<input type="password" name="userPw"  placeholder="请输入密码">
					</div>
					<p class="submit" onClick="check1()">立即登录<img id="indicator" src="<%=path %>/images/loading.gif" style="display:none"/></p> 
					 
				</div>
			</div>
		</div>
  </FORM>
</body> 
